package cn.edu.glut.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * 
 * @author Caizhfy
 * @email caizhfy@163.com
 * @createTime 2017年12月9日
 * @description 选题实体
 *
 */
@Data
@NoArgsConstructor
@Entity
@Table
public class Selection implements Serializable{
	
	private static final long serialVersionUID = -4122759703807416741L;
	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	private String id;
	@ManyToOne
	@JoinColumn(name = "subject_id")
	private Subject subject;
	@ManyToOne
	@JoinColumn(name = "student_id")
	private Student student;
	private Integer wish;				//1为第一志愿， 2为第二志愿
	@Column(name = "is_select")
	private Integer isSelection;		//1为确选，0为未确选，-1为落选,-2为退选
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "select_time")
	private Date selectTime;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "success_time")
	private Date successTime;
	
	public Selection(Subject subject, Student student, Integer wish, Integer isSelection) {
		super();
		this.subject = subject;
		this.student = student;
		this.wish = wish;
		this.isSelection = isSelection;
	}
}
